#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Event.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class ValueSpecification;

/// <summary>
/// ChangeEvent
/// A ChangeEvent models a change in the system configuration that makes a condition
/// true.
/// </summary>
class UMLMODEL_EXPORT ChangeEvent : public Event {

public: // Constructors and destructors
    explicit ChangeEvent(const QString& umlType="uml::ChangeEvent");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// changeExpression getter
    /// A Boolean-valued ValueSpecification that will result in a ChangeEvent whenever
    /// its value changes from false to true.
    /// </summary>
    shared_ptr<ValueSpecification> changeExpression() const;

    /// <summary>
    /// changeExpression setter
    /// A Boolean-valued ValueSpecification that will result in a ChangeEvent whenever
    /// its value changes from false to true.
    /// </summary>
    void setChangeExpression(shared_ptr<ValueSpecification> value);

private: // Fields
    /// <summary>
    /// changeExpression
    /// A Boolean-valued ValueSpecification that will result in a ChangeEvent whenever
    /// its value changes from false to true.
    /// </summary>
    shared_ptr<ValueSpecification> changeExpression_;

};

} // namespace uml
